package com.xie.springCloud.comtroller;

import com.xie.springCloud.pojo.Dept;
import com.xie.springCloud.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RestController
public class ComsumerDeptController {

    @Autowired
    private IDeptService service;

    @RequestMapping("/consumer/dept/add")
    public boolean addDept(Dept dept){
        return this.service.addDept(dept);
    }

    @RequestMapping("/consumer/dept/get/{id}")
    public Dept getById(@PathVariable("id") Long id){
        return this.service.getById(id);
    }

    @RequestMapping("/consumer/dept/list")
    public List<Dept> getList(){
        return this.service.getList();
    }

}
